package main;

import security.*;
import error.*;
import classloader.*;

public class Main {
	
	public static void main(String[] args) {
		
		/* Set debug policy from launch parameters */
		Debug.setPolicy(args);
		Debug.println("mocha - System initial bootup (debug module loaded)");

		/* Set Mocha security manager */
		try {
			System.setSecurityManager(new MochaSecurityManager());
			Debug.println("SecurityManager policy applied");
		} catch(SecurityException se) {
			/* For security reasons, automatically panic() when security policy can't be set */
			FatalError.panic();
		}
		
		Debug.println("System is going to halt now!");
		CommonFuncs.shutdown(0);
	}

}
